package com.yh.eval;

import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

public class MoreSettingsActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_more_settings);

    }

    public void onClick(View v){
        switch (v.getId()){
            case R.id.btnBack:
                finish();
                break;
            case R.id.btnCamera: // 查看摄像头

                break;
            case R.id.btnRecordSetting:

                break;
            case R.id.btnSysSetting:
                Intent intent = new Intent();
                ComponentName componentName = new ComponentName(
                        "com.android.settings", // 设置应用包名
                        "com.android.settings.Settings" //com.android.settings.Settings Settings$WifiSettingsActivity
                );
                intent.setComponent(componentName);
                intent.setAction(Intent.ACTION_MAIN);
                intent.addCategory(Intent.CATEGORY_LAUNCHER);
                try {
                    startActivity(intent);
                } catch (ActivityNotFoundException e) {
                    e.printStackTrace();
                    // 备选处理：启动通用设置页面
                    Intent fallbackIntent = new Intent(android.provider.Settings.ACTION_SETTINGS);

                    startActivity(fallbackIntent);
                }
                break;
        }
    }


}
